﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace TestSplashScreen
{
    public partial class fMain : Form
    {
        public fMain()
        {
            InitializeComponent();
            this.Load += new EventHandler(fMain_Load);
        }

        void fMain_Load(object sender, EventArgs e)
        {
            showSplashScreen();
        }

        private void showSplashScreen()
        {
            using (fSplashScreen fsplash = new fSplashScreen())
            {
                if (fsplash.ShowDialog() == System.Windows.Forms.DialogResult.Cancel) this.Close();
            }
            using (Login l = new Login())
            {
                if (l.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                    txtLogin.Text = Program.gUsuario.loginn;
                else
                    Close();
            }
        }

        private void btnNProveedor_Click(object sender, EventArgs e)
        {
            Proveedores.frmAltaProveedor frm = new Proveedores.frmAltaProveedor();
            frm.MdiParent = this;
            frm.Show();
        }

        private void btnMProveedor_Click(object sender, EventArgs e)
        {
            Proveedores.frmSeleccionarProveedor frm = new Proveedores.frmSeleccionarProveedor();
            frm.MdiParent = this;
            frm.Show();
        }

        private void btnBProveedor_Click(object sender, EventArgs e)
        {
            Proveedores.frmSeleccionarProveedor frm = new Proveedores.frmSeleccionarProveedor();
            frm.MdiParent = this;
            frm.Show();
        }

        private void btnNMaterial_Click(object sender, EventArgs e)
        {
            Materiales.frmAltaMaterial frm = new Materiales.frmAltaMaterial();
            frm.MdiParent = this;
            frm.Show();
        }

        private void btnMMaterial_Click(object sender, EventArgs e)
        {
            Materiales.frmSeleccionarMaterial frm = new Materiales.frmSeleccionarMaterial();
            frm.MdiParent = this;
            frm.Show();
        }

        private void btnBMaterial_Click(object sender, EventArgs e)
        {
            Materiales.frmSeleccionarMaterial frm = new Materiales.frmSeleccionarMaterial();
            frm.MdiParent = this;
            frm.Show();
        }

        private void nuevoTipoToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Tipo.frmAltaTipo frm = new Tipo.frmAltaTipo();
            frm.MdiParent = this;
            frm.Show();
        }

        private void modificarTipoToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Tipo.frmSeleccionarTipo frm = new Tipo.frmSeleccionarTipo();
            frm.MdiParent = this;
            frm.Show();
        }

        private void borrarTipoToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Tipo.frmSeleccionarTipo frm = new Tipo.frmSeleccionarTipo();
            frm.MdiParent = this;
            frm.Show();
        }

        private void nuevaFamiliaToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Familia.frmAltaFamilia frm = new Familia.frmAltaFamilia();
            frm.MdiParent = this;
            frm.Show();
        }

        private void modificarFamiliaToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Familia.frmSeleccionarFamilia frm = new Familia.frmSeleccionarFamilia();
            frm.MdiParent = this;
            frm.Show();
        }

        private void borrarFamiliaToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Familia.frmSeleccionarFamilia frm = new Familia.frmSeleccionarFamilia();
            frm.MdiParent = this;
            frm.Show();
        }

        private void nuevoCicloToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Ciclo.frmAltaCiclo frm = new Ciclo.frmAltaCiclo();
            frm.MdiParent = this;
            frm.Show();
        }

        private void modificarCicloToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Ciclo.frmSeleccionarCiclo frm = new Ciclo.frmSeleccionarCiclo();
            frm.MdiParent = this;
            frm.Show();
        }

        private void borrarCicloToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Ciclo.frmSeleccionarCiclo frm = new Ciclo.frmSeleccionarCiclo();
            frm.MdiParent = this;
            frm.Show();
        }

        private void añadirMódulosToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Tienen_Modulo.frmModCiclo frm = new Tienen_Modulo.frmModCiclo();
            frm.MdiParent = this;
            frm.Show();
        }

        private void nuevoMóduloToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Modulo.frmAltaModulo frm = new Modulo.frmAltaModulo();
            frm.MdiParent = this;
            frm.Show();
        }

        private void modificarMóduloToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Modulo.frmSeleccionarModulo frm = new Modulo.frmSeleccionarModulo();
            frm.MdiParent = this;
            frm.Show();
        }

        private void borrarMóduloToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Modulo.frmSeleccionarModulo frm = new Modulo.frmSeleccionarModulo();
            frm.MdiParent = this;
            frm.Show();
        }

        private void añadirACicloToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Tienen_Modulo.frmModCiclo frm = new Tienen_Modulo.frmModCiclo();
            frm.MdiParent = this;
            frm.Show();
        }

        private void nuevoUsuarioToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Usuarios.frmAltaUsuario frm = new Usuarios.frmAltaUsuario();
            frm.MdiParent = this;
            frm.Show();
        }

        private void modificarUsuarioToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            Usuarios.frmSeleccionarUsuario frm = new Usuarios.frmSeleccionarUsuario();
            frm.MdiParent = this;
            frm.Show();
        }

        private void borrarUsuarioToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            Usuarios.frmSeleccionarUsuario frm = new Usuarios.frmSeleccionarUsuario();
            frm.MdiParent = this;
            frm.Show();
        }

        private void consultarToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Proveedores.frmSeleccionarProveedor frm = new Proveedores.frmSeleccionarProveedor();
            frm.MdiParent = this;
            frm.Show();
        }

        private void consultarTipoDeMaterialToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Tipo.frmSeleccionarTipo frm = new Tipo.frmSeleccionarTipo();
            frm.MdiParent = this;
            frm.Show();
        }

        private void consultarMaterialToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Materiales.frmSeleccionarMaterial frm = new Materiales.frmSeleccionarMaterial();
            frm.MdiParent = this;
            frm.Show();
        }

        private void consultarFamiliaToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Familia.frmSeleccionarFamilia frm = new Familia.frmSeleccionarFamilia();
            frm.MdiParent = this;
            frm.Show();
        }

        private void consultaCiclosToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Ciclo.frmSeleccionarCiclo frm = new Ciclo.frmSeleccionarCiclo();
            frm.MdiParent = this;
            frm.Show();
        }

        private void consultaMóduloToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Modulo.frmSeleccionarModulo frm = new Modulo.frmSeleccionarModulo();
            frm.MdiParent = this;
            frm.Show();
        }

        private void consultaUsuarioToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Usuarios.frmSeleccionarUsuario frm = new Usuarios.frmSeleccionarUsuario();
            frm.MdiParent = this;
            frm.Show();
        }

        private void btnTMaterial_Click(object sender, EventArgs e)
        {
            Tipos_material.frmTipMat frm = new Tipos_material.frmTipMat();
            frm.MdiParent = this;
            frm.Show();
        }

        private void btnNPedido_Click(object sender, EventArgs e)
        {

        }
    }
}
